﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace SiteUnion
{
   public struct UBT
   {
      /// <summary>
      /// 成语词典
      /// </summary>
      public const string DICT_CY = "ub_dict_cy";

      /// <summary>
      /// 成语词典标签
      /// </summary>
      public const string DICT_CY_TAG = "ub_dict_cy_tag";

      /// <summary>
      /// 缩写词典
      /// </summary>
      public const string DICT_SUOXIE = "ub_dict_suoxie";

      /// <summary>
      /// 缩写词典标签
      /// </summary>
      public const string DICT_SUOXIE_TAG = "ub_dict_suoxie_tag";

      /// <summary>
      /// 专题表
      /// </summary>
      public const string SPECIAL = "ub_special";
      

      /// <summary>
      /// 成员表
      /// </summary>
      public const string ACCOUNT = "account";
   }

   /// <summary>
   ///  Defines some constants that used frequently data fields.
   /// </summary>
   public struct DF
   {
      /// <summary>
      /// 所有字段
      /// </summary>
      public const string ALL = "*";

      /// <summary>
      /// 对象标识
      /// </summary>
      public const string OID = "oid";

      /// <summary>
      /// 成员标识
      /// </summary>
      public const string MID = "mid";

      /// <summary>
      /// 对象名称
      /// </summary>
      public const string ONAME = "oname";

      /// <summary>
      /// 发布时间
      /// </summary>
      public const string PUBDATE = "pubdate";

      /// <summary>
      /// 最后编辑时间
      /// </summary>
      public const string EDITDATE = "editdate";

      /// <summary>
      /// 点击次数
      /// </summary>
      public const string VIEWS = "views";

      /// <summary>
      /// the comments field 's name
      /// </summary>
      public const string COMMENTS = "comments";

      /// <summary>
      ///  the state field's name
      /// </summary>
      public const string STATE = "state";
   }

   /// <summary>
   /// 
   /// </summary>
   public sealed class DC
   {
      /// <summary>
      /// 
      /// </summary>
      /// <param name="dr"></param>
      /// <returns></returns>
      public static int OID(IDataReader dr)
      {
         return dr.GetInt32(dr.GetOrdinal(DF.OID));
      }

      /// <summary>
      /// 
      /// </summary>
      /// <param name="dr"></param>
      /// <returns></returns>
      public static int MID(IDataReader dr)
      {
         return dr.GetInt32(dr.GetOrdinal(DF.MID));
      }

      /// <summary>
      /// 
      /// </summary>
      /// <param name="dr"></param>
      /// <returns></returns>
      public static int Views(IDataReader dr)
      {
         return dr.GetInt32(dr.GetOrdinal(DF.VIEWS));
      }

      /// <summary>
      /// 
      /// </summary>
      /// <param name="dr"></param>
      /// <returns></returns>
      public static int Comments(IDataReader dr)
      {
         return dr.GetInt32(dr.GetOrdinal(DF.COMMENTS));
      }

      /// <summary>
      /// 
      /// </summary>
      /// <param name="dr"></param>
      /// <returns></returns>
      public static int State(IDataReader dr)
      {
         return dr.GetInt32(dr.GetOrdinal(DF.STATE));
      }
   }

   public struct UBP
   {
      public const string EXSIT = "sp_exsit";

      /// <summary>
      /// 获取分页数据的存储过程
      /// </summary>
      public const string PAGING = "sp_paging";
   }

   public struct OrderType
   {
      public const string DESC = "1";

      public const string ASC = "0";
   }
}
